00001
00002
00003
00004
00005
00006 #ifndef _exception_h_
00007 #define _exception_h_
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #include <string>
00019 #include <stdexcept>
00020
00021 namespace gridpack {
00022
00023
00024
00025
00026 class Exception : public std::exception {
00027 public:
00028
00029
00030 Exception(void)
00031 : std::exception(), message_("Unknown GridPACK Error")
00032 {}
00033
00034
00035 explicit Exception(const std::string& s)
00036 : std::exception(), message_(s)
00037 {}
00038
00039
00040 explicit Exception(const char *s)
00041 : std::exception(), message_(s)
00042 {}
00043
00044
00045 Exception(const Exception& old)
00046 : std::exception(old), message_(old.message_)
00047 {}
00048
00049
00050 ~Exception(void) throw()
00051 {}
00052
00053
00054 const char *what(void) const throw()
00055 {
00056 return message_.c_str();
00057 }
00058
00059 protected:
00060
00061
00062 std::string message_;
00063
00064 };
00065
00066
00067
00068 }
00069 #endif // _exception_h_